package com.goldgov.mobile;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.goldgov.distancelearning.service.DistancelearningQuery;
import com.goldgov.utils.MobileStaticData;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import springfox.documentation.annotations.ApiIgnore;

/** 
 * @ClassName: PartyForMobileController 
 * @Description: TODO
 * @author hanxiangyu
 * @date 2018年6月27日 下午3:51:17 
 */
@RestController
@RequestMapping("/mobile/party")
@Api("党建头条移动接口")
public class PartyForMobileController {
	
	@GetMapping
	@ApiOperation(value = "党建头条列表", notes ="党建头条列表")
	public String getPartyList(HttpServletRequest request,Model model) throws Exception{
		String url = "http://rap2api.taobao.org/app/mock/13521/model/list";
		Map<String, String> map = new HashMap<>();
		map.put("id", "2893169055492498");
		return MobileStaticData.getStaticData(url, map);
	}
	@GetMapping("/getPartyById")
	@ApiOperation(value = "党建头条详情", notes ="党建头条列表")
	public String getPartyById(@ApiParam(value="id",required=false) @PathVariable("id") String id,HttpServletRequest request,Model model) throws Exception{
		String url = "http://rap2api.taobao.org/app/mock/13521/model/detail";
		Map<String, String> map = new HashMap<>();
		if (id != null || !"".equals(id)) {
			map.put("id", id);
		}else {
			map.put("id", "2928661096449842");
		}
		return MobileStaticData.getStaticData(url, map);
	}
	
	
	
}
